#!/usr/bin/python
# -*- coding: UTF-8 -*-
from kptest.config.enum import HostType

from extension.test_logic.DpuLogic import DpuLogic


class DPU2_FUNCTION_048(DpuLogic):
    """
        Name:
            DPU2_FUNCTION_048
        Label:
            bmc版本信息显示
        PreCondition:

        TestStep:
            1) soc系统/远程机可以通过带内/外方式获取DPU bmc版本信息
            带外命令：ipmitool -Ianplus -H <soc_bmc_ip> -U <soc_bmc_user>-P <soc_bmc_user_password> mc info
        ExpectedResult:
            A) 正常查询到智能网卡得BMC版本信息
        Parameters:

        Author:
            HK1342
        Last Modified:
            2025/05/09
        Remark:

    """

    # 测试执行前配置等准备操作
    def pre_test_case(self):
        super().pre_test_case()

    # 测试步骤
    def procedure(self):
        mc_info = self.get_dpu_mc_info()
        dpu_ibmc_version = mc_info.get('Firmware Revision')
        self.assertNotEqual(dpu_ibmc_version, None, "DPU BMC版本信息获取失败")

    # 测试结束后恢复环境
    def post_test_case(self):
        pass
